#pragma once

#include "DAEFloat4.h"
#include "DAEFloat3.h"




/**
* This value class represents a rotation with a time element.
* This is a utility class for the animation module.
* @author Koen Samyn
*/
class TimedRotation
{
public:
	/**
	* Utility constructor for find purposes.
	* @param time the time for this rotation.
	*/
	TimedRotation(int time);
	/**
	* Creates a new TimedRotation object
	* @param time the time for this rotation.
	*/
	TimedRotation(int time, DAEFloat4 rotation,DAEFloat3 pivot,DAEFloat3 scale);
	/**
	* Destroys the TimedRotation object.
	*/
	virtual ~TimedRotation(void);

	/**
	* Returns the time for this rotation.
	* @return the time.
	*/
	unsigned int GetTime() const{
		return m_Time;
	}
	/**
	* Returns the rotation.
	* @return the rotation.
	*/
	const DAEFloat4& GetRotation() const
	{
		return m_Rotation;
	}

	/**
	* Updates the rotation part of this timed rotation.
	*/
	void SetRotation(float rx,float ry,float rz);

	/**
	* Get the pivot point.
	* @return the pivot point.
	*/
	const DAEFloat3& GetPivot() const
	{
		return m_Pivot;
	}
	
	const DAEFloat3& GetScale() const
	{
		return m_Scale;
	}

private:
	/**
	* The rotation value.
	*/
	DAEFloat4 m_Rotation;
	/**
	* The pivot value.
	*/
	DAEFloat3 m_Pivot;
	/**
	* The scale value.
	*/
	DAEFloat3 m_Scale;
	/**
	* The time value
	*/
	unsigned int m_Time;
};

struct TimedRotationSorter
{
public:
	/*
	* Functor for sorting.
	* @param a the first object to compare.
	* @param b the second object to compare.
	* @return true if the first object is before the second object.
	*/
	bool operator ()(TimedRotation const& a, TimedRotation const& b) const{
		return a.GetTime() < b.GetTime();
	}
};

